#ifndef __MAIN_WINDOW__
#define __MAIN_WINDOW__ 1

#include <QMainWindow>
#include <QLabel>
#include <QProgressBar>
#include <QHBoxLayout>

#include "main_widget.h"

class CMainWindow : public QMainWindow
{
	Q_OBJECT

public:
	CMainWindow(QWidget* pParent = 0);
	virtual ~CMainWindow();

	static const QString sGUIName;

private slots:
	void connectRequested(QString pHost, quint16 pPort);
	void startRequested();
	void configRequested();
	void sendConfigRequested();
	void disconnectRequested();
	void connectionError(QString pErrorMsg);
	void clientConnected(QString pHost, quint16 pPort);
	void clientDisconnected();
	void infoReceived(ELogLevel pLogLevel, QString pLogMessage);
	void closeReceived();
	void saveToFile();
	void loadFromFile();

private:
	CPropertiesModel* mConfModel;
	CMainWidget mMainWidget;
	QMenu* mFileMenu;
	QMenu* mCommandsMenu;
	QAction* mSaveAction;
	QAction* mLoadAction;
	QAction* mExitAction;
	QAction* mStartAction;
	QAction* mRequestConfigAction;
	QAction* mSendConfigAction;
	QLabel mStatusBarLabel;

	CClientConnection* mConnection;

	void createMenu();
	void createStatusBar();
	void setupActions();
	void connectConnectionBindings();
	void disconnectConnectionBindings();
};

#endif /* __MAIN_WINDOW__ */

